﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InvoiceReport.aspx.cs" Inherits="ReportPages_AlphabeticalListOfProductsReport" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Invoice Report</title>
    <style type="text/css">
        .style1
        {
            width: 103px;
        }
        .style2
        {
            width: 99px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <a href="../Default.aspx">Home</a><br /><br />
        <table style="width:100%;">
            <tr>
                <td class="style1">
                    Order Id:</td>
                <td class="style2">
                    <asp:TextBox ID="orderIdTextBox" runat="server" Width="83px"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="Button1" runat="server" Text="Refresh" Width="111px" 
                        onclick="Button1_Click" />
                </td>
            </tr>
        </table>
        <br /><br />    
    
    </div>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
            Font-Size="8pt" Height="672px" Width="744px">
            <LocalReport ReportPath="Reports\Invoice.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="AccessDataSource1" 
                        Name="SimpleReportsDataSet_InvoiceReportDataTable" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/NorthwindNET.mdb" 
            
            
            SelectCommand="SELECT OrderDetail.OrderID AS ID, [Order].CustomerId, [Order].ShipName, [Order].ShipAddress, [Order].ShipCity, [Order].ShipRegion, [Order].ShipPostalCode, [Order].ShipCountry, [Order].OrderDate, [Order].RequiredDate, [Order].ShippedDate, OrderDetail.UnitPrice, OrderDetail.Quantity, OrderDetail.Discount, CCur((OrderDetail.UnitPrice * OrderDetail.Quantity) * (1 - OrderDetail.Discount) / 100 * 100) AS ExtendedPrice, [Order].Freight, OrderDetail.ProductID, [Order].ShipperId, [Order].EmployeeID, OrderDetail.OrderID, Employee.FirstName + ' ' + Employee.LastName AS SalesPerson, Customer.ContactName, Customer.Address, Customer.City, Customer.Region, Customer.PostalCode, Customer.Country, Product.Name AS ProductName, Shipper.Name AS ShipVia FROM ((Product INNER JOIN OrderDetail ON Product.ID = OrderDetail.ProductID) INNER JOIN ((Shipper INNER JOIN ([Order] INNER JOIN Customer ON [Order].CustomerId = Customer.ID) ON Shipper.ID = [Order].ShipperId) INNER JOIN Employee ON [Order].EmployeeID = Employee.ID) ON OrderDetail.OrderID = [Order].ID) WHERE (prmOrderID = -1) OR (prmOrderID = [Order].ID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="orderIdTextBox"
                    Name="prmOrderId" PropertyName="Text" Size="10" Type="Int32" 
                    DefaultValue="-1" />
            </SelectParameters>
        </asp:AccessDataSource>
    </form>
</body>
</html>
